﻿@{
    Layout = null;
    string docClsName = ViewData["docClsName"] == null ? "最新信息" : ViewData["docClsName"].ToString();
    string docClsCd = ViewData["docClsCd"] == null ? "" : ViewData["docClsCd"].ToString();
}
@model ElingOA6_DSJCJ.Model.Document
           
@{
    Dictionary<string, string> dicDocClsNameList = ViewData["dicDocClsNameList"] == null ? new Dictionary<string, string>() : ViewData["dicDocClsNameList"] as Dictionary<string, string>;
   
}

@helper  GetConfigShowText(string keyName, Dictionary<string, string> dicDocClsNameList)
    {
        if (dicDocClsNameList.ContainsKey(keyName))
        {
    @:@dicDocClsNameList[keyName]
       }
    }

<!DOCTYPE html>
<html>
<head>
    <title>@ElingOA6_DSJCJ.Common.GlobalConstant.CONSTRING_SYSTITLE</title>
    <link href="@Url.Content("~/Content/ztzl_css.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script>

        //发布信息
        function btnOk() {
            docId = $("#hidDocId").val();
            var txtCon = $.trim($('#txtCon').val());
            if (txtCon == "") {
                alert("请输入内容");
                $('#txtCon').focus();
                return;
            }

            //$('#txtCon').attr("disabled", "disabled");

            if ($('#txtCon').val() != "") {
                $.ajax({
                    type: 'POST',
                    url: '/Index/DocLeadInstruct',
                    data: { docid: docId, content: txtCon },
                    success: function (result) {
                        if (result == "empty") {
                            alert("请重新登录或者输入文本内容");
                        }
                        else if (result == "yes") {

                            alert("批示成功");

                            window.location = window.location.href;
                        }
                        else {
                            alert("批示失败");
                        }

                        //$('#txtCon').removeAttr("disabled");
                    }
                });
            }
        }

        function btnDel() {
            docId = $("#hidDocId").val();
            $.ajax({
                type: 'POST',
                url: '/Index/DelInstruct',
                data: { docid: docId },
                success: function (result) {
                    if (result == "empty") {
                        alert("删除失败");
                    }
                    else {
                        alert(result);
                        window.location = window.location.href;
                    }
                }

            });
        }
        //获取批示内容
        function btnUpdate() {
            docId = $("#hidDocId").val();
            $.ajax({
                type: 'POST',
                url: '/Index/GetInstruct',
                data: { docid: docId },
                success: function (result) {
                    if (result == "empty") {
                        alert("获取失败");
                    }
                    else {
                        $('#txtCon').focus();
                        $("#txtCon").val(result);

                    }
                }

            });
        }
        function DocRefImp() {
            docId = $("#hidDocId").val();

            var entryModel = $("#hdDocRefImpCls").val();

            var obj = new Object();
            if (entryModel != "") {
                obj.Value = entryModel;
            }
            else {
                obj.Value = "";
            }
            var docClsList = window.showModalDialog("/Index/DocRefImpClsChoose?docID=" + docId, obj, "dialogWidth=300px;dialogHeight=500px");
            if (typeof (docClsList) != "undefined") {

                var docClsHtml = JSON.parse(docClsList);
                var showText = "";
                for (var i = 0; i < docClsHtml.length; i++) {
                    showText += docClsHtml[i].Text + ",";
                }
                if (showText != "") {
                    showText = "此信息已被下列栏目引用：" + showText.substring(0, showText.lastIndexOf(','));
                }
                //            var docClsList=JSON.stringify(docClsHtml);
                $.ajax({
                    type: 'POST',
                    url: '/Index/AddDocRefImp',
                    data: { docid: docId, docClsList: docClsList },
                    success: function (result) {
                        if (result == "SUCCESS") {
                            //                        $("#hdDocRefImpCls").val(docClsList);
                            //                        $("#hdDocRefImpClsName").val(showText);
                            //                        $('#spanDocRefImp').html(showText);
                            alert('操作成功！');
                            window.location.reload();
                        }
                        else {
                            alert('操作失败，原因：' + result);
                        }
                    }

                });
            }
        }
</script>

</head>
<body>

<div class="ztzl-main">
    <div class="ztzl-header"><img src="@ViewData["logUrl"].ToString()" width="1000" height="226"/></div>
    
    @{
        if (dicDocClsNameList.Count > 0)
        {
                <div class="ztzl-nav2">
                <a href="/Column/lzzc?clsCd=@docClsCd">首页</a>
                @foreach(KeyValuePair<string,string> dicDocClsNameModel in dicDocClsNameList)
                {
                    <a href="/Column/lzzc_List?clsCd=@dicDocClsNameModel.Key">@dicDocClsNameModel.Value</a>
                } 
                </div>
        }
    }
   <div class="ztzl-mainconlist">  
  <div class="list_page">
    	<div class="where"><b>当前位置：</b><a href="/Column/lzzc?clsCd=@docClsCd">首页</a>&gt;<a href="/Column/lzzc_List?clsCd=@ViewData["currentClscd"]">@ViewData["docName"]</a></div>
        <div class="article">
            <h2 class="c">@Model.FTitle</h2>
             @{
            if(Model.FSubTitle!=null && Model.FSubTitle!="")
            {
                @Html.Raw("<h3>"+Model.FSubTitle+"</h3>");
            }
            if (Model.FReferenceNo != null && Model.FReferenceNo!="")
            {
                @Html.Raw("<h4>"+Model.FReferenceNo+"</h4>");
            }
            
            }  
             <div>
                @*<span style="margin-right:700px;"></span>*@
               
            </div> 
            <p class="info c mb10"><span>作者:@Model.FAuthor</span> &nbsp;<span>发布时间：@Model.FPubDate.ToString("yyyy-MM-dd")</span> <span>来源：@Model.FDeptName</span> <span>阅读次数：<span id="hits">@Model.FReadCnt.ToString()</span>
             <span style="text-align:right; font-size:14px;">
                    @if (ElingOA6_DSJCJ.Common.OperateSession.get(ElingOA6_DSJCJ.Common.GlobalConstant.PARAM_LOGINID) != null)
                    {
                        <a onclick="DocRefImp()" href="javascript:" style="color:Red;">[引用]</a>
                    }
                </span> </span> </p>
    <div class="article-box">
     <p>    @if (Model.FEditMode == "H")
                {
                    @Html.Raw(Model.FContentTxt)
                }
              </p>  
               @if (!string.IsNullOrEmpty( @Model.FDownTitle)&!string.IsNullOrEmpty( @Model.FDownDateString))
           {
          <p style="FONT-SIZE: 16px; FONT-FAMILY: 宋体; TEXT-ALIGN: right"> @Model.FDownTitle
          <br />
          @Model.FDownDateString
          </p>
               
         
          }
      </div>
       <div class="p4">
                @if (null != ViewData["docAttach"])
                {
                    List<ElingOA6_DSJCJ.Model.DocAttach> docAttachList = ViewData["docAttach"] as List<ElingOA6_DSJCJ.Model.DocAttach>;
                    if (docAttachList.Count > 0)
                    {
                    <table width="880" border="0" style="text-align: left" cellpadding="0" cellspacing="0" style="margin-top: 10px;">
                        <tr>
                            <td colspan="2" width="980" height="40" style="border-bottom: 2px solid #CCCCCC">
                                <br />
                                附件:</td>
                        </tr>
                        @foreach (ElingOA6_DSJCJ.Model.DocAttach attachModel in docAttachList)
                        {
                            <tr>
                                <td colspan="2" width="980" height="40" style="border-bottom: 2px solid #CCCCCC">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="/Index/AttachDownLoad?attachID=@attachModel.FAttachID">@(string.IsNullOrEmpty(attachModel.FAttachDesc) ? attachModel.FAttachOldFileName : attachModel.FAttachDesc)</a></td>
                            </tr>
                        }
                    </table>
                    }
                }
            </div>
        @if (ViewData["FIsExamine"].ToString() == "Y")
           {
               using (Html.BeginForm("DocView", "Index", FormMethod.Post, new { id = "portForm" }))
               {
           @*局长批示的内容*@
           <table width="880" border="0" cellpadding="0" cellspacing="0"  style="margin-top:10px;">
          @{
                   if (null != ViewData["leadInstruct"])
                   {
                       System.Data.DataSet dslt = ViewData["leadInstruct"] as System.Data.DataSet;
                       if (dslt.Tables[0].Rows.Count > 0)
                       {


                           foreach (System.Data.DataRow row in dslt.Tables[0].Rows)
                           {
                               if (row["FEmplNo"].ToString() == ViewData["FEmplNo"].ToString())
                               {
                           <tr>
            <td colspan="2" class="hg25 db" style="padding:5px 10px 0 10px; font-size:14px;" >
                <span style="color: #6699cc;">@row["FEmpName"]</span>&nbsp;&nbsp;
                <span style="color: #a3bb50;">@row["FExamineDate"]</span>&nbsp;&nbsp;&nbsp;<span  onclick="btnUpdate()" style="color: blue;cursor:pointer;">修改</span>|<span onclick="btnDel()" style="color: blue;cursor:pointer;">删除</span> <br />
                <span>&nbsp;&nbsp;&nbsp;&nbsp;@row["FExamineContent"]</span>   
              </td>
          </tr>
                               }
                               else
                               {
                              <tr>
            <td colspan="2" class="hg25 db" style="padding:5px 10px 0 10px; font-size:14px;" >
                <span style="color: #6699cc;">@row["FEmpName"]</span>&nbsp;&nbsp;
                <span style="color: #a3bb50;">@row["FExamineDate"]</span><br />
                <span>&nbsp;&nbsp;&nbsp;&nbsp;@row["FExamineContent"]</span>     
              </td>
          </tr>
                               }
                           }


                       }
                   }
          
              }
              @if (ViewData["FIsInstruct"].ToString() == "Y")
              {
              <tr align="center"><td style="font-size:14px;">局长批示:</td></tr>
              <tr align="center"><td>@*<input type="text" id="txtCon" />*@
              @Html.TextArea("txtCon", "", 3, 90, "sty")</td></tr>
              <tr align="center"><td><input type="button" onclick="btnOk();" value="确定" />
          
              </td></tr>
              }
              </table>
              
        <input id="hidEmplNo" type="hidden" value="@ViewData["FEmplNo"]" />
               }
           }
      
        @*信息引用*@
           <script type="text/javascript">
               $(function () {
                   $('#spanDocRefImp').html($('#hdDocRefImpClsName').val());
               });
           </script>
           <div style="width:880px; display:block; padding-top:10px; padding-bottom:10px;" align="left">
           <span id="spanDocRefImp" ></span>
           </div>
            @Html.Hidden("hdDocRefImpCls", ViewData["docRefImpClsJson"] == null ? "" : ViewData["docRefImpClsJson"].ToString())
            @Html.Hidden("hdDocRefImpClsName", ViewData["docRefImpClsName"] == null ? "" : ViewData["docRefImpClsName"].ToString())
            <input id="hidDocId" type="hidden" value="@ViewData["FDocId"]" />
    <div class="opt" style="width: 100%;">【 <a href="/Index/DocViewPrint?docId=@Model.FDocId" target="_blank">打印此页</a> | <a href="javascript:window.close();">关闭窗口</a> 】</div>
   </div>
    </div></div>
    <div class="ztzl-bottom">@Html.Raw(ViewData["CopyRight"].ToString())</div>
    
   
</div>


</body>
</html>
